﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RoboticOperationMerge.CUiROMGridNodeInfo
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using C1.Win.C1FlexGrid;
using System;
using System.Collections.Generic;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.RoboticOperationMerge;

internal abstract class CUiROMGridNodeInfo : IDisposable
{
  protected bool m_disposed;
  protected ITxObject m_nodeObject;
  protected Row m_gridRow;
  protected int m_level;
  protected string m_niceName;
  protected CUiROMDataUtils.NodeType m_nodeType;
  protected string m_mergeScheme = "";
  protected Dictionary<CUiROMDataUtils.CellStyleCategory, string> m_customStylesMap;
  protected CUiROMDataUtils.CellState m_cellState;

  public CUiROMGridNodeInfo()
  {
    this.m_nodeObject = (ITxObject) null;
    this.m_gridRow = (Row) null;
    this.m_level = 0;
    this.m_niceName = "";
    this.m_nodeType = CUiROMDataUtils.NodeType.NotSet;
    this.m_customStylesMap = (Dictionary<CUiROMDataUtils.CellStyleCategory, string>) null;
    this.m_cellState = CUiROMDataUtils.CellState.NotSet;
  }

  public string MergeScheme
  {
    get => this.m_mergeScheme;
    set => this.m_mergeScheme = value;
  }

  public ITxObject NodeObject
  {
    get => this.m_nodeObject;
    set => this.m_nodeObject = value;
  }

  public Row GridRow
  {
    get => this.m_gridRow;
    set => this.m_gridRow = value;
  }

  public int Level
  {
    get => this.m_level;
    set => this.m_level = value;
  }

  public string NiceName
  {
    get => this.m_niceName;
    set => this.m_niceName = value;
  }

  public CUiROMDataUtils.NodeType NodeType
  {
    get => this.m_nodeType;
    set => this.m_nodeType = value;
  }

  public Dictionary<CUiROMDataUtils.CellStyleCategory, string> CustomStylesMap
  {
    get => this.m_customStylesMap;
    set => this.m_customStylesMap = value;
  }

  public CUiROMDataUtils.CellState State
  {
    get => this.m_cellState;
    set => this.m_cellState = value;
  }

  public virtual void Dispose()
  {
  }

  public void SetCustomStyle(
    CUiROMDataUtils.CellStyleCategory categoryStyle,
    string associatedStyle)
  {
    if (associatedStyle == null)
      return;
    if (this.m_customStylesMap != null)
    {
      if (this.m_customStylesMap.ContainsKey(categoryStyle))
        this.m_customStylesMap[categoryStyle] = associatedStyle;
      else
        this.m_customStylesMap.Add(categoryStyle, associatedStyle);
    }
    else
    {
      this.m_customStylesMap = new Dictionary<CUiROMDataUtils.CellStyleCategory, string>();
      this.m_customStylesMap.Add(categoryStyle, associatedStyle);
    }
  }

  public string GetCustomStyle(CUiROMDataUtils.CellStyleCategory categoryStyle)
  {
    string customStyle = (string) null;
    if (this.m_customStylesMap != null && this.m_customStylesMap.ContainsKey(categoryStyle))
      customStyle = this.m_customStylesMap[categoryStyle];
    return customStyle;
  }

  public void RemoveCustomStyle(CUiROMDataUtils.CellStyleCategory categoryStyle)
  {
    if (this.m_customStylesMap == null || !this.m_customStylesMap.ContainsKey(categoryStyle))
      return;
    this.m_customStylesMap.Remove(categoryStyle);
  }

  public void ClearCustomStyles()
  {
    if (this.m_customStylesMap == null)
      return;
    this.m_customStylesMap.Clear();
  }
}
